#ifndef DIRECT_INPUT
#define DIRECT_INPUT
#include "DirectInputDefine.h"
#include "IInput.h"
#include "dinput.h"

class DirectInput : public IInput
{
public:
	DirectInput();
	virtual ~DirectInput();

	virtual	bool	Initialize(void* hInstance);
	virtual bool	Finalize();

	virtual bool	IsKeyDown(int iKeyFlag);
	virtual bool	IsKeyUp(int iKeyFlag);

	virtual	bool	MouseMove(int& iX,int& iY);
	virtual bool	MouseLButtonDown();
	virtual bool	MouseLButtonUp();
	virtual bool	MouseLButtonDClick();
	virtual bool	MouseRButtonDown();
	virtual bool	MouseRButtonUp();
	virtual bool	MouseRButtonDClick();

public:
	bool			SetCooperativeLevel(HWND hHand);
	bool			GetDeviceState();

private:
	LPDIRECTINPUT8			m_lpDInput8;

	LPDIRECTINPUTDEVICE8W	m_lpKeyboardDevice8;
	LPDIRECTINPUTDEVICE8W	m_lpMouseDevice8;

	UCHAR					m_keyState[256];
	DIMOUSESTATE			m_kMouseState;
};

#endif
